package org.example.feignclient;

import org.example.entity.Book;
import org.example.feignclient.impl.BookFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

//@FeignClient("server-book")  表示对哪个服务进行降级处理
@FeignClient(value = "server-book",fallback = BookFeignClientFallBack.class) // 服务降级处理，指定具体的降级处理方法
public interface BookFeignClient {

    @RequestMapping("/book/{bid}")
    public Book findBookById(@PathVariable("bid") int bid);
}
